//
//  IFIndexClassCell.m
//  chanlin
//
//  Created by Ryan on 14-12-21.
//  Copyright (c) 2014年 chanlin. All rights reserved.
//

#import "IFIndexClassCell.h"
#import "UIView+Utils.h"
#import "UIImageView+WebCache.h"

@implementation IFIndexClassCell

- (void)uiInit{
    [super uiInit];
    self.middle=[[UIView alloc] init];
    self.middle.frame=CGRectMake(0, 0, GlobleWidth, 7.f);
    self.middle.backgroundColor=RGB(232, 232, 232);
    [self.baseView addSubview:self.middle];
    
    self.icon=[[UIImageView alloc] init];
    self.icon.frame=CGRectMake(11.f, 12.f+7, 35.f, 35.f);
    [self.baseView addSubview:self.icon];
    
    self.title=[[UILabel alloc] init];
    self.title.font=[UIFont systemFontOfSize:16.f];
    self.title.textColor=RGB(0x3e, 0x3e, 0x3e);
    self.title.frame=CGRectMake(self.icon.right+13.f, self.icon.top+2, GlobleWidth-(self.icon.right+13.f), self.title.font.lineHeight);
    [self.baseView addSubview:self.title];
    
    self.info=[[UILabel alloc] init];
    self.info.font=[UIFont systemFontOfSize:10.f];
    self.info.textColor=RGB(0x58, 0x57, 0x57);
    self.info.frame=CGRectMake(self.title.left, self.title.bottom + 6, self.title.width, 10);
    [self.baseView addSubview:self.info];
    
}


- (void)loadData:(CLList *)newsList{
    if(_isStrNotNull(newsList.thumnail)){
        [self.icon sd_setImageWithURL:[NSURL URLWithString:newsList.thumnail] placeholderImage:nil];
    }else{
        self.icon.image=nil;
    }
    
    self.title.text=newsList.title;
    self.info.text=newsList.info;
}

@end
